local M = {
    "rcarriga/nvim-notify",
    keys = {
        { "<leader>nh", "<cmd>Telescope notify<cr>", desc = "notify history" },
    },
}

function M.config()
    local banned_messages = { "No information available" }
    vim.notify = function(msg, ...)
        for _, banned in ipairs(banned_messages) do
            if msg == banned then
                return
            end
        end
        return require "notify"(msg, ...)
    end

    local notify = require "notify"

    -- 设置 nvim-notify 的配置
    notify.setup {
        -- 设置通知的最大宽度
        max_width = 80,
        -- 设置渲染样式
        render = "minimal",
        -- 你还可以设置其他选项，例如：
        stages = "static",
        top_down = false,
        right_left = false,
        timeout = 2000,
    }
    -- 确保这是最后加载的配置之一
    vim.schedule(function()
        require("notify").setup {
            timeout = 2000,
        }
    end)
end

return M

